<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>销售价格限价</title>
		<link rel="stylesheet" type="text/css" charSet="UTF-8"
			href="css/public.css">
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/sorttable.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/public.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/salesprice.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/validate.js"></script>
			
		<script type="text/javascript">
		function validate()
		{	
			var bottomBid = document.getElementById("bottomBid");
			var bid = document.getElementById("bid");
			
			if(!(isNotNull(bottomBid,'限价价格')&&f_check_float(bottomBid,'限价价格'))){
			return false;
			}
			
			if(!compare(bottomBid,bid,'最低限价')){
			return false;
			}
			
		}
		//全局变量，用于判断隐藏或显示
		var i=1 ;
		//隐藏显示客户文本框函数
		function hiddenClient(){
			var client = document.getElementById('client');
			if(i%2!=0){
				client.style.display='none';
			}
			else{
				client.style.display='block';
			}
			i++ ;
		}
		</script>
	</head>

	<body>
		<div id="info_all" style="width: 300px;">
			<div id="info_top">
				销售价格限价
			</div>
			<div style="padding: 4px; width: 300px; margin-top: 6px;">
				<s:form action="controlSalesprice.action" method="post" onsubmit="return validate()"
					theme="simple">
					<table
						style="margin-top: 10px; background: #fbfbfb; color: #403040;"
						align="center">
						<tr style="font-size: 9pt">
							<s:radio name="customerStytle" list="#{'0':'当前客户','1':'所有客户'}"
								value="0" onclick="hiddenClient()"></s:radio>
						</tr>
						
						<tr id="client">
							<td width="80px">
								客户名称:
							</td>
							<td>
								<s:hidden
									name="salespriceDTO.salesprice.customerId"></s:hidden>
								<s:textfield name="salespriceDTO.customer.customerName" id="customerName"
									size="15" readonly="true"></s:textfield>
							</td>
						</tr>
					
						<tr>
							<td width="100px">
								物料名称:
							</td>
							<td>
								<s:hidden
									name="salespriceDTO.salesprice.materialId"></s:hidden>
								<s:textfield name="salespriceDTO.material.materialName" id="customerName"
									size="15" readonly="true"></s:textfield>
							</td>
						</tr>
						<tr>
							<td width="80px">
								报价：
							</td>
							<td>
								<s:textfield name="salespriceDTO.salesprice.bid" id="bid" size="15" readonly="true"></s:textfield>
							</td>
						</tr>
						<tr>
							<td width="80px">
								最低限价：
							</td>
							<td>
								<s:textfield name="salespriceDTO.salesprice.bottomBid" id="bottomBid" size="15"></s:textfield>
							</td>
						</tr>
						<tr>
						</tr>
						<tr>
							<td align="center">

								<input type="submit" value="保存" onClick="" onFocus="this.blur()"
									onmouseover="this.className='btnover'"
									onmouseout="this.className='btnout'" class="btnsize" />
							</td>
							<td colspan="2">
								<div style="margin: 6px; text-align: left;">
									<input type="button" value="返回" onClick="window.history.go(-1)" onFocus="this.blur()"
										onmouseover="this.className='btnover'"
										onmouseout="this.className='btnout'" class="btnsize" />
								</div>
							</td>
						</tr>
					</table>
				</s:form>
			</div>
		</div>
	</body>
</html>
